_IG_FetchFeedAsJSON(
  "http://img.livetv.ru/rss/gadget_ru.xml",
  function(feed) {

    if (feed == null){
      _gel("content_div").innerHTML = '&#x41D;&#x435;&#x442; &#x434;&#x430;&#x43D;&#x43D;&#x44B;&#x445;';
      return;
    }

    j = 0;
    var html = "";
    if (feed.Entry) {
      html += '<table>';
      for (var i = 0; i < feed.Entry.length; i++) {      
        var milliseconds = feed.Entry[i].Date * 1000;
        var date = new Date(milliseconds);

        var summary = JSON.parse(feed.Entry[i].Summary);

        if(!summary){
          var str = feed.Entry[i].Summary;
          var start = str.indexOf('"description" : "') + '"description" : "'.length;
          var end   = str.indexOf('"livetextUserId"');
          str_tmp  = str.substring(0, start);
          str_tmp += '", ' + str.substring(end, str.length);
          summary = JSON.parse(str_tmp);
        }

        var live_str = '';
        var zz1 = (parseInt(summary.actiontime) + 30)* 60 * 1000;  
        end_dt = new Date(milliseconds + (parseInt(summary.actiontime) + 30)* 60 * 1000);
          
        cur_dt = new Date();
        if(end_dt > cur_dt){
          j++; 
          if(j > 30){
            break;
          }  
          if(date < cur_dt){
            live_str = "<img src=\"http://img.livetv.ru/img/live.gif\">";
          }

          var tetx_str = ''
          if((typeof(summary.livetextUserId) != 'undefined') && (summary.livetextUserId != '0')){
            tetx_str = "<img src=\"http://gadget.livetv.ru/tetx.gif\">";
          }  


          html += "<tr>";


          html += "<td width=30><img src=\"http://img.livetv.ru/img/icons/"+ summary.icon + ".gif\"></td>";
          html += "<td>";
          html += "<a href=\""+ feed.Entry[i].Link +"\" target=\"_blank\">" + feed.Entry[i].Title +"</a> " + live_str + tetx_str + "<br><span class=\"gray\">"+ summary.sport + ". " + summary.competition +"<br>" + date.toLocaleDateString() + " " + date.toLocaleTimeString() + "</span>";
          html += "</td>";
          html += "</tr>";

          html += "<tr>";
          html += "</tr>";
        }
      }
      html += "</table>";
    }
    _gel("content_div").innerHTML = html;
  }, 
  100, true);